/* eslint-disable no-undef */
import request from '@/router/axios'

// 获取菜单树
export const menuTree = () => {
  return request({
    url: '/backend/menu/menuTree',
    method: 'POST'
  })
}

// 删除
export const deleteMenu = (params) => {
  return request({
    url: '/backend/menu/delete',
    method: 'POST',
    params
  })
}

// 排序
export const sort = (data) => {
  return request({
    url: '/backend/menu/sort',
    method: 'POST',
    data
  })
}

// 详情
export const getById = (params) => {
  return request({
    url: '/backend/menu/getById',
    method: 'POST',
    params
  })
}
// 新增或修改菜单
export const edit = (data) => {
  return request({
    url: '/backend/menu/edit',
    method: 'POST',
    data
  })
}
